1. Field of the Invention
The present invention generally relates to a video image processing method, in particular, to an intra prediction method for a luma block of a video.
2. Description of Related Art
H.264 is a new generation of video compression standard drafted by the Joint Video Team of Video Coding Expert Group (VCEG) and Moving Pictures Experts Group (MPEG). This technique is referred to as advanced video coding (AVC) or together H.264/AVC after being integrated with MPEG-4 Part 10 (ISO/IEC 14496-10). Relative researches reveal that, compared with MPEG-2 and MPEG-4, H.264/AVC significantly improves the compression rate and the video quality, and is thus widely used for video conference, video broadcast, video streaming service, and other video applications.
H.264 employs pixels rebuilt by intra frame coding and inter frame coding to predict coding blocks, thereby achieving better spatial and temporal prediction than previous standards, such as H.263+. When performing pixel prediction with the intra prediction technique, in order to improve the coding efficiency, H.264 predicts through the relativity between an image block and its adjacent blocks in the spatial domain, and only records the adopted prediction modes and the actual errors during data storage. As the values of the errors are smaller than the original pixel values, and the data volume after coding is also reduced, the bit rate of coding can thus be effectively reduced.
The aforementioned adjacent blocks generally refer to blocks on the left, upper left, upper right of, and above the current coding block. The pixels in the adjacent blocks have been coded and reconstructed, so the recorded information can be reused. Taking the prediction of a 4*4 block for example, FIG. 1 is a conventional configuration diagram of a 4*4 block of H.264, in which a-p represent pixels of the luma block, and the rest A-M are neighbor pixels. In addition, A-H represent neighbor pixels in the above and upper right blocks of the luma block, I-L represent neighbor pixels in the left block, and M represents the neighbor pixel in the upper left block. The prediction mode of H.264 is to perform prediction through pixel values of the neighbor pixels.
According to the image complexity, the intra prediction technique can be classified into 4*4 luma prediction mode, 16*16 luma prediction mode, and 8*8 chroma prediction mode. The 4*4 luma prediction mode further includes nine different prediction modes based on the prediction direction. For example, FIG. 2 is a schematic view of nine prediction modes included in the 4*4 luma prediction mode of H.264 specifications. Liang-Gee Chen further sets forth equation lists of the nine prediction modes (as shown in FIG. 3) in “Analysis, fast algorithm, and VLSI architecture design for H.264/AVC intra frame coder” issued in the journal of IEEE transactions on circuits and systems for video technology. Referring to FIGS. 2 and 3, the prediction modes include a DC mode and the other modes in eight directions, and the equations can be concluded according to positions of the pixels to be predicted as follows:
      Prediction    ⁢                  ⁢    value    =            {                        [                                                                                          ∑                    i                                    ⁢                                                                          ⁢                                                                                    (                        coefficient                        )                                            i                                        ×                                                                                                                                            (                                          edge                      ⁢                                                                                          ⁢                      pixel                      ⁢                                                                                          ⁢                      value                                        )                                    i                                                              ]                +                  (          Round          )                    }        /                  2        shift            .      in which iεedge pixels L, K, J, I, M, A, B, C, D, E, F, G, H. For example if Mode 0 (i.e., a vertical mode) is selected, the prediction value of the pixel (y, x) at column x, row y can be calculated by the following equations:Pixel (0,0), (1,0), (2,0), (3,0): neighbor pixel value A;Pixel (0,1), (1,1), (2,1), (3,1): neighbor pixel value B;Pixel (0,2), (1,2), (2,2), (3,2): neighbor pixel value C;Pixel (0,3), (1,3), (2,3), (3,3): neighbor pixel value D;Further, if Mode 3 (i.e., a diagonal down-left mode) is selected, the pixel prediction value can be calculated by the following equations:Pixel (0,0): neighbor pixel value (A+2B+C+2) shifted rightwards for 2 bits;Pixel (0,1), (1,0): neighbor pixel value (B+2C+D+2) shifted rightwards for 2 bits;Pixel (0,2), (1,1), (2,0): neighbor pixel value (C+2D+E+2) shifted rightwards for 2 bits;Pixel (0,3), (1,2), (2,1), (3,0): neighbor pixel value (D+2E+F+2) shifted rightwards for 2 bits;Pixel (1,3), (2,2), (3,1): neighbor pixel value (E+2F+G+2) shifted rightwards for 2 bits;Pixel (2,3), (3,2): neighbor pixel value (F+2G+H+2) shifted rightwards for 2 bits;Pixel (3,3): neighbor pixel value (G+3H+2) shifted rightwards for 2 bits.
The 4*4 luma prediction mode first employs the above nine prediction modes to search for a predictor with a 4*4 luma block as a unit, then subtracts the predictor from the 4*4 luma block to obtain a residual image, and afterward converts the residual image by the adopted prediction mode to get an image code for the 4*4 sub-block.
However, the above coding manner is required to respectively calculate the prediction values in the nine prediction modes, and then to select the most appropriate prediction mode for coding.